package org.example.domain.model.config;


import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

@Configuration
public class UrlShortenerPathNotFoundConfig {
    public static final String PAGE_NOT_FOUND = "/page/notfound";
    @Value("${server.servlet.context-path}")
    private String contextPath;

    public String getUrlShortenerPathNotFound() {
        return (StringUtils.isNotEmpty(contextPath) ? contextPath : "") + PAGE_NOT_FOUND;
    }

    public String getContextPath() {
        return contextPath;
    }
}
